﻿using PropertyChanged;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace GEPL.StandardModulesLibrary.ViewModels.Common
{
    [ImplementPropertyChanged]
    public class ConditionIfViewModel
    {
        public ObservableCollection<KeyValuePair<string, string>> ConditionsList { get; set; }

        public bool EndIf { get; set; }

        #region Radio buttons

        public bool If { get; set; }

        public bool IfElse { get; set; }

        public bool Else { get; set; }

        #endregion Radio buttons

        #region Condition elements

        public string Value1 { get; set; }

        public string Value2 { get; set; }

        public string SelectedCondition { get; set; }

        #endregion Condition elements

        public ConditionIfViewModel()
        {
            EndIf = false;
            If = true;
            InitConditionsList();
            SelectedCondition = ConditionsList[0].Key;
        }

        private void InitConditionsList()
        {
            ConditionsList = new ObservableCollection<KeyValuePair<string, string>>
            {
                new KeyValuePair<string, string>("==", Properties.Resources.Conditions_Equals),
                new KeyValuePair<string, string>("!=", Properties.Resources.Conditions_NotEquals),
                new KeyValuePair<string, string>(">", Properties.Resources.Conditions_GreaterThan),
                new KeyValuePair<string, string>(">=", Properties.Resources.Conditions_GreaterOrEqual),
                new KeyValuePair<string, string>("<", Properties.Resources.Conditions_LowerThan),
                new KeyValuePair<string, string>("<=", Properties.Resources.Conditions_LowerOrEqual),
                new KeyValuePair<string, string>("in", Properties.Resources.Conditions_In)
            };
        }
    }
}